package com.smart.community.parking.controller;

import com.smart.community.commons.result.Result;
import com.smart.community.commons.utils.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 车辆管理控制器
 * 
 * @author Wu.Liang
 * @since 2024-12-21
 */
@Slf4j
@RestController
@RequestMapping("/parking/vehicles")
@Tag(name = "车辆管理", description = "车辆管理相关接口")
public class VehicleController {

    /**
     * 测试车辆管理接口
     * 
     * @author Wu.Liang
     */
    @GetMapping("/test")
    @Operation(summary = "测试车辆管理接口")
    public Result<String> testVehicle() {
        try {
            Long userId = SecurityUtils.getCurrentUserId();
            if (userId == null) {
                return Result.fail("用户未登录");
            }

            return Result.success("车辆管理服务正常");
        } catch (Exception e) {
            log.error("车辆管理测试失败", e);
            return Result.fail("测试失败：" + e.getMessage());
        }
    }
} 